package edu.asu.sapa.sas;

import java.util.*;

public class ValueVertex {
	HashSet<SASOperator> prevailOperators = new HashSet<SASOperator>();
	Variable var;
	int valueID;
	
	public ValueVertex(Variable var, int id) {
		valueID = id;
	}
	
	public boolean addPrevailsOperator(SASOperator op) {
		return prevailOperators.add(op);
	}

	public HashSet<SASOperator> getPrevailOperators() {
		return prevailOperators;
	}
	
	public int getValueID() {
		return valueID;
	}
	
	public Variable getVariable() {
		return var;
	}
	
	@Override
	public String toString() {
		StringBuilder st = new StringBuilder("ID: " + valueID + " ");
		for (SASOperator op : prevailOperators) {
			st.append(op).append(' ');
		}
		return st.toString();
	}
}
